<?php

//UMA new
use Illuminate\Database\Seeder;
use App\Models\NikkeiScoreRate;

class NikeiScoreRateSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $row = [
            'min_change' => -32677,
            'max_change' => -401,
            'rate' => 0.95,
        ];
        NikkeiScoreRate::create($row);
        $rate = 96;
        for ($i = -4; $i < 6; $i++) {
            $range = $i == 0 ? 100 : 99;
            $row['min_change'] = $i  * 100 + ($i > 0 ? 1 : 0);
            $row['max_change'] = $i < 5? $row['min_change'] + $range : 32677;
            $row['rate'] = ($rate ++) / 100;
            NikkeiScoreRate::create($row);
        }
    }
}
